3.3 \(\int \cot (c+d x) (a+b \tan (c+d x)) (B \tan (c+d x)+C \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=42 \[ -\frac {(a C+b B) \log (\cos (c+d x))}{d}+x (a B-b C)+\frac {b C \tan (c+d x)}{d} \]

[Out]

(B*a-C*b)*x-(B*b+C*a)*ln(cos(d*x+c))/d+b*C*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3632, 3525, 3475} \[ -\frac {(a C+b B) \log (\cos (c+d x))}{d}+x (a B-b C)+\frac {b C \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + b*Tan[c + d*x])*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

(a*B - b*C)*x - ((b*B + a*C)*Log[Cos[c + d*x]])/d + (b*C*Tan[c + d*x])/d

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3632

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)
*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[1/b^2, Int[(a + b*Tan[e + f*x])
^(m + 1)*(c + d*Tan[e + f*x])^n*(b*B - a*C + b*C*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rubi steps

\begin {align*} \int \cot (c+d x) (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx &=\int (a+b \tan (c+d x)) (B+C \tan (c+d x)) \, dx\\ &=(a B-b C) x+\frac {b C \tan (c+d x)}{d}+(b B+a C) \int \tan (c+d x) \, dx\\ &=(a B-b C) x-\frac {(b B+a C) \log (\cos (c+d x))}{d}+\frac {b C \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 59, normalized size = 1.40 \[ a B x-\frac {a C \log (\cos (c+d x))}{d}-\frac {b B \log (\cos (c+d x))}{d}-\frac {b C \tan ^{-1}(\tan (c+d x))}{d}+\frac {b C \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + b*Tan[c + d*x])*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

a*B*x - (b*C*ArcTan[Tan[c + d*x]])/d - (b*B*Log[Cos[c + d*x]])/d - (a*C*Log[Cos[c + d*x]])/d + (b*C*Tan[c + d*
x])/d

________________________________________________________________________________________

fricas [A]  time = 1.06, size = 50, normalized size = 1.19 \[ \frac {2 \, {\left (B a - C b\right )} d x + 2 \, C b \tan \left (d x + c\right ) - {\left (C a + B b\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(2*(B*a - C*b)*d*x + 2*C*b*tan(d*x + c) - (C*a + B*b)*log(1/(tan(d*x + c)^2 + 1)))/d

________________________________________________________________________________________

giac [A]  time = 2.27, size = 50, normalized size = 1.19 \[ \frac {2 \, C b \tan \left (d x + c\right ) + 2 \, {\left (B a - C b\right )} {\left (d x + c\right )} + {\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(2*C*b*tan(d*x + c) + 2*(B*a - C*b)*(d*x + c) + (C*a + B*b)*log(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

maple [A]  time = 0.39, size = 66, normalized size = 1.57 \[ a B x -b C x -\frac {b B \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {B a c}{d}+\frac {b C \tan \left (d x +c \right )}{d}-\frac {a C \ln \left (\cos \left (d x +c \right )\right )}{d}-\frac {C b c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x)

[Out]

a*B*x-b*C*x-b*B*ln(cos(d*x+c))/d+1/d*B*a*c+b*C*tan(d*x+c)/d-1/d*a*C*ln(cos(d*x+c))-1/d*C*b*c

________________________________________________________________________________________

maxima [A]  time = 0.60, size = 50, normalized size = 1.19 \[ \frac {2 \, C b \tan \left (d x + c\right ) + 2 \, {\left (B a - C b\right )} {\left (d x + c\right )} + {\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*(2*C*b*tan(d*x + c) + 2*(B*a - C*b)*(d*x + c) + (C*a + B*b)*log(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

mupad [B]  time = 8.79, size = 58, normalized size = 1.38 \[ B\,a\,x-C\,b\,x+\frac {C\,b\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {B\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d}+\frac {C\,a\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)*(B*tan(c + d*x) + C*tan(c + d*x)^2)*(a + b*tan(c + d*x)),x)

[Out]

B*a*x - C*b*x + (C*b*tan(c + d*x))/d + (B*b*log(tan(c + d*x)^2 + 1))/(2*d) + (C*a*log(tan(c + d*x)^2 + 1))/(2*
d)

________________________________________________________________________________________

sympy [A]  time = 0.65, size = 82, normalized size = 1.95 \[ \begin {cases} B a x + \frac {B b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {C a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - C b x + \frac {C b \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\relax (c )}\right ) \left (B \tan {\relax (c )} + C \tan ^{2}{\relax (c )}\right ) \cot {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)**2),x)

[Out]

Piecewise((B*a*x + B*b*log(tan(c + d*x)**2 + 1)/(2*d) + C*a*log(tan(c + d*x)**2 + 1)/(2*d) - C*b*x + C*b*tan(c
 + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))*(B*tan(c) + C*tan(c)**2)*cot(c), True))

________________________________________________________________________________________